from django import forms
from sorl.curator.util import tinymce
from example_project.pages.models import Page

class PageForm(forms.ModelForm):
    def __init__(self, *args, **kwargs):
        super(PageForm, self).__init__(*args, **kwargs)
        self.fields['description'].widget.attrs={'class': 'smallta'}
        self.fields['content'].widget.attrs={'class': 'mceEditor'}
    
    class Meta:
        model = Page
    
    class Media:
        js = tinymce('js/tinymce.js')
        css = {'all': ('css/admin.css',)}
